package com.sherlockHolmes.init.controller;
import com.sherlockHolmes.init.base.result.Ajax;
import com.sherlockHolmes.init.entity.dto.UserInfoDTO;
import com.sherlockHolmes.init.service.UserInfoService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/userInfo")
public class UserInfoController {
    @Resource
    private UserInfoService userInfoService;

    /**
     * 更新用户信息
     */
    @PostMapping("/update")
    public Ajax update(UserInfoDTO userInfo){
        try{
            return Ajax.success(userInfoService.updateUserInfo(userInfo));
        }catch (Exception e){
            return Ajax.fail(e);
        }
    }
}
